Package-level declarations
Types
Link copied to clipboard
class AgentBuilder(val name: String, val provider: String = "embabel", val version: <Error class: unknown class> = Semver(), val description: String, promptContributors: List<<Error class: unknown class>> = emptyList())
Instances of this are usually created via the convenient agent() function.
Link copied to clipboard
Link copied to clipboard
data class BiInputActionContext<A1, A2>(val input1: A1, val input2: A2, val actionContext: ActionContext) : InputsActionContext, ActionContext
Link copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
inline fun <A, B, C> aggregate(transforms: List<(context: InputActionContext<A>) -> B>, noinline merge: (list: List<B>, context: OperationContext) -> C): AgentScopeBuilder<C>
Run all the transforms and merge the results.
Link copied to clipboard
inline fun <A1, A2, B : Any, C> biAggregate(transforms: List<(context: BiInputActionContext<A1, A2>) -> B>, noinline merge: (list: List<B>) -> C): AgentScopeBuilder<C>
fun <A1, A2, B : Any, C> biAggregate(transforms: List<(context: BiInputActionContext<A1, A2>) -> B>, merge: (list: List<B>) -> C, a1Class: Class<A1>, a2Class: Class<A2>, bClass: Class<B>, cClass: Class<C>): AgentScopeBuilder<C>
Aggregate taking 2 inputs
Link copied to clipboard
inline fun <A, B, C> branch(noinline a: (context: InputActionContext<A>) -> Branch<B, C>): AgentScopeBuilder<Branch<B, C>>
Convenience method to branch from A to B or C using Kotlin reified types.
fun <A, B, C> branch(a: (context: InputActionContext<A>) -> Branch<B, C>, aClass: Class<A>, bClass: Class<B>, cClass: Class<C>): AgentScopeBuilder<Branch<B, C>>
Branch from A to B or C using Kotlin reified types. Makes conditionals easy to express.
Link copied to clipboard
inline fun <A, B, C> chain(noinline a: (context: InputActionContext<A>) -> B, noinline b: (context: InputActionContext<B>) -> C): AgentScopeBuilder<C>
Convenience method to chain A to B via C using Kotlin reified types.
fun <A, B, C> chain(a: (context: InputActionContext<A>) -> B, b: (context: InputActionContext<B>) -> C, aClass: Class<A>, bClass: Class<B>, cClass: Class<C>): AgentScopeBuilder<C>
Creates a chain from A to B via C. Emits actions.
Link copied to clipboard
inline fun <A, B, C> Function<InputActionContext<A>, B>.javaAndThen(that: Function<InputActionContext<B>, C>): AgentScopeBuilder<C>
Link copied to clipboard
fun <T, R> Collection<T>.parallelMap(context: OperationContext, concurrencyLevel: Int = 10, dispatcher: <Error class: unknown class> = Dispatchers.IO, transform: suspend (T) -> R): List<R>
Map parallel. Block on all results
Link copied to clipboard
inline fun <C> repeat(noinline what: () -> AgentScopeBuilder<C>, noinline until: (c: C, context: OperationContext) -> Boolean): AgentScopeBuilder<C>
fun <C> repeat(what: () -> AgentScopeBuilder<C>, until: (c: C, context: OperationContext) -> Boolean, cClass: Class<C>): AgentScopeBuilder<C>
Link copied to clipboard
inline fun <A, B : Any, C> repeatableAggregate(startWith: C, transforms: List<(context: BiInputActionContext<A, C>) -> B>, noinline merge: (list: List<B>) -> C): AgentScopeBuilder<C>
Special aggregate that works like an accumulator. If the condition is not satisfied, your transformer methods will be called again with the latest updated context.